/**
 * 
 */
package org.ranch.model;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;

/**
 * represents a category of a concept Eg. AnimalTpe
 *
 */
@Entity
@Table(name = "concept_categories")
public class ConceptCategory extends BaseData implements Comparable<ConceptCategory>, Serializable {

    /**
     * 
     */
    private static final long serialVersionUID = 1L;
    /**
     * the name of the ConceptCategory.
     */
    private String name;
    /**
     * the description of the ConceptCategory.
     */
    private String description;
    /**
     * the code of the ConceptCategory.
     */
    private String code;

    /**
     * default Constructor.
     */
    public ConceptCategory() {
        super();
    }

    /**
     * Constructor with initial specified values.
     *
     * @param conceptCategoryName
     *            {@link #name}
     * @param conceptCategoryDescription
     *            {@link #description}
     * @param conceptCategoryCode
     *            {@link #code}
     */
    public ConceptCategory(String conceptCategoryName,
            String conceptCategoryDescription, String conceptCategoryCode) {
        super();
        this.name = conceptCategoryName;
        this.description = conceptCategoryDescription;
        this.code = conceptCategoryCode;
    }

    @Column(name = "concept_category_code", nullable = true, unique = true)
    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    @Column(name = "category_description", nullable = false)
    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    @Column(name = "category_name", nullable = false)
    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int compareTo(ConceptCategory o) {
        return this.getName().compareToIgnoreCase(o.getName());
    }
}
